<%@page import="ufc.quixada.petti.model.Participante"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Seven-Credenciamento</title>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <link rel="stylesheet" href="estilo.css"  />
        <script>
            function ExecutaAcao(valor) {
                if(valor==1){
                document.form.action = "confirmacaoCredenciamento";
            }else{
                document.form.action="/confirmacaoCredenciamento";
            }
            }
        </script>
    <body>
        <div id="cabecalho">
            <h1>Credenciamento</h1>
        </div>
        <div id="corpo">

            <div id="busca">
                <form>
                    <rotulo>Buscar Participante: </rotulo>

                    <input type="text" name="search"  id = "id_search"/> <input type="submit" value="buscar"/>
                    <br/>
                    <input type="checkbox" name="porEmail" />
                    <rotulo>Por E-mail</rotulo>
                </form>
            </div>
            <div id="formulario">

                <%
                    List<Participante> participantes = (List<Participante>) request.getAttribute("participantes");
                %>


                <table border="1" id="lista-participantes" cellpadding="2px" cellspacing="2px" width="750px">
                    <thead>
                        <tr>
                            <th>Nome:</th>
                            <th>E-mail</th>
                            <th>Estatus</th>
                        </tr>
                    </thead>
                    <tbody>
                        <% for (Participante participante : participantes) {%>
             
                    <form  method="post" name="form">

                        <input type="hidden" name="idEvento" value= <%=request.getAttribute("id")%>>


                        <tr>
                        <input type="hidden" name="id" value=<%=participante.getId()%>  />
                        <td><%= participante.getNome()%></td>
                        <td><%= participante.getEmail()%></td>
                        <td><button onclick="ExecutaAcao(1)" > Presente</button><button onclick="ExecutaAcao(0)" > Ausente</button>   </td>

                        </tr>




                    </form>
                    <% }%>
                    </tbody>

                </table>
            </div>
        </div>
        <div id="rodape">
            <br/>
        </div>

    </body>
</html>